let express = require('express')
let svgCaptcha = require('svg-captcha')
let routes = express.Router()
let qs = require('querystring')
let asscess_token = ''
const param = qs.stringify({
	'grant_type': 'client_credentials',
	'client_id': 'TCs9N88mgNyBEOGhKGsWgzo3',
	'client_secret': 'tSgDmFCx5HGGH8oXixTEWA1bhRV7TfYB'
})
exports.par = param
routes.get('/login', require('./user-routes/login'))
routes.post('/dologin', require('./user-routes/dologin'))
routes.get('/main', (req, res) => {
	res.render('./admin/welcomePage')
})
routes.get('/hospitallist', (req, res) => {
	res.render('./admin/hospitallist')
})
routes.get('/familydat', (req, res) => {
	res.render('./admin/familydat')
})
routes.get('/pageGL', (req, res) => {
	res.render('./admin/pageGL')
})
routes.get('/editpage', (req, res) => {
	res.render('./admin/editpage')
})
routes.get('/Conmanagement', (req, res) => {
	res.render('./admin/Conmanagement')
})
routes.get('/editinfo', (req, res) => {
	res.render('./admin/editinfo')
})
routes.get('/facelogin', (req, res) => {
	res.render('./admin/facetwo')
})
routes.get('/addface', (req, res) => {
	res.render('./admin/adduser')
})
routes.post('/logintoken', require('./user-routes/logintoken'))
routes.post('/facedologin', require('./user-routes/facedologin'))
routes.post('/registface', require('./user-routes/registface'))
routes.get('/captcha', require('./user-routes/captcha'))

routes.get('/esc', (req, res) => {
	req.app.locals.username = ''
	res.redirect('/admin/login')
})

module.exports = routes
